#ifndef QD3DTIMEQUERY_H
#define QD3DTIMEQUERY_H
#include <d3d11.h>
#include <QMap>
#include <string>

class QD3DTimeQuery
{
public:
	QD3DTimeQuery ();
	~QD3DTimeQuery ();

	void begin ();
	void end ();
	void addCheckPoint (std::string pointName);
	QMap< std::string, double > &getCheckPointTimes ();
	const QMap< std::string, double > &getCheckPointTimes () const;
	double getTime (std::string point) const;
	int getCheckPointSize () const;
	double getDuration (std::string startPoint, std::string endPoint) const;
private:
	ID3D11Query *_pTimestampDisjointQuery;
	ID3D11Query *_pTimestampQuery;
	QMap< std::string, double > _checkPointTimes;
	bool _isExecuting;
	bool _isResultValid;
};

#endif // QD3DTIMEQUERY_H
